package patterns.strategy;

/**
 * Created by lenovo on 2016/12/9 0009.
 * context行为类，持有策略接口对象，用于实现不同的策略。
 */
public class Context {
    private IStrategy strategy;

    public Context(IStrategy strategy) {
        this.strategy = strategy;
    }

    public int executeStrategy(int num1, int num2) {
        return strategy.doOperation(num1, num2);
    }
}
